#pragma once
#ifdef WIN32
#include <Windows.h>

namespace Lk
{
	namespace Threading
	{

// Defines a recursive mutex (Locks from the same thread will increment counter)
class Mutex
{
public:
	
	//ctor/dtor
	 Mutex();
	~Mutex();

	 void Lock();
	 void Unlock();

private:

	CRITICAL_SECTION m_cs;
};

//Defines an event syncronization object
class Event
{
public:
 
	//ctor/dtor
	//event name assumes static allocation
	 Event( const char * eventName );
	~Event();

	bool Trigger() volatile; //Volatile required? Could be called concurrently
	void Wait() volatile;   

private:

	HANDLE m_eventHandle;
	const char* m_eventName;
}; 

	} //end threading
} // end lk

#endif 